package com.site.dao.impl.dining;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.site.dao.dining.RestaurantPhotoDao;
import com.site.model.dining.RestaurantPhotoInfo;
import com.site.util.base.dao.BaseDaoImpl;

/**
 * 餐厅相册Dao
 * @author win7
 *
 */
@Repository
public class RestaurantPhotoDaoImpl extends BaseDaoImpl implements  RestaurantPhotoDao{

	@Override
	public List<RestaurantPhotoInfo> getRestaurantMainPhotoByRid(Long id) {
		String hql = "from RestaurantPhotoInfo where 1 = 1 ";
		Map<String,Object> map = new HashMap<String, Object>();
		if(null != id){
			hql+=" and rid = :rid";
			map.put("rid", id);
			return super.findByHQL(hql, map);
		} else {
			return null;
		}
		
	}
}
